# 导包
import pymysql

# 连接数据库
conn = pymysql.connect(host='192.168.126.133', port=3306, user='root', password='123456', database='litemall', charset='utf8')
# 创建游标
cursor = conn.cursor()
# 执行SQL语句,错误事务要进行回滚
for i in range(0,9000):
    sql = f'''INSERT INTO litemall.litemall_goods (id, goods_sn, name, category_id, brand_id, gallery, keywords, brief, is_on_sale, sort_order, pic_url, share_url, is_new, is_hot, unit, counter_price, retail_price, detail) VALUES (119{i}, '119{i}', '测试商品{i}', 0, 0, '[]', '', '', 1, 100, '', null, 1, 1, '’件‘', 9999.00, 12000.00, '<p>测试商品详情</p>');'''
    cursor.execute(sql)
    conn.commit()
# 关闭游标
cursor.close()
# 关闭连接
conn.close()
